/**
 * 判断attrs的 key:value obj中是否都有
 * @param {u} obj
 * @param {*} attrs
 */
function isMatch(obj, attrs) {
  const keys = Object.keys(attrs)
  const length = keys.length

  obj = Object(obj)
  for (let i = 0; i < length; ++i) {
    const key = keys[i]
    if (!(key in obj) || attrs[key] !== obj[key]) {
      return false
    }
  }
  return true
}

export default isMatch
